// 素材请求相关模块
import request from '@/utils/request'

export const uploadImage = data => { // publish上传图片
  return request({
    method: 'POST',
    url: '/mp/v1_0/user/images',
    data
  })
}

export const getImages = params => { // 用户图片素材管理
  return request({
    method: 'GET',
    url: '/mp/v1_0/user/images',
    params
  })
}

export const collectImage = (id, collect) => { // 收藏用户图片素材
  return request({
    method: 'PUT',
    url: `/mp/v1_0/user/images/${id}`,
    data: {
      collect
    }
  })
}

export const deleteImage = (id) => { // 收藏用户图片素材
  return request({
    method: 'DELETE',
    url: `/mp/v1_0/user/images/${id}`
  })
}
